<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/view/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>网上报名-合肥猎头网</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="${contextPath}/view/css/user.css"
	type="text/css" media="all" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<script type="text/javascript">
<!--

	var depart = new Array();
	<c:forEach items="${OfficeListCommand.departs}" var="depart" varStatus="status">
	depart[${status.index }] = new Object();
	depart[${status.index }].id = '${depart.id}';
	    <c:choose>
	        <c:when test='${office.name == ""}'>
	        depart[${status.index }].name = '';
	        </c:when>
	        <c:otherwise>
	        depart[${status.index }].name = '${depart.name}';
	        </c:otherwise>
	    </c:choose>
	    depart[${status.index }].examId = '${depart.examId}';
	</c:forEach>
	
	function changeExam() {
	    var examId = document.getElementById("examId").value;
	    var departEl = document.getElementById("departId");
	    departEl.options.length=0;
	    var i = 0;
	    for (; i < depart.length; i++) {
	        if (examId == -1) {
	        	departEl.options.add(new Option(depart[i].name, depart[i].id));
	            continue;
	        }
	        if (depart[i].examId == examId || depart[i].id == -1) {
	        	departEl.options.add(new Option(depart[i].name, depart[i].id));
	        }
	    }
	}
	function editO(officeId) {
		document.getElementById("oid").value = officeId;
		return true;
	}
	function deleteO(officeId) {

		if (!confirm("确定要删除该岗位吗？")) {
			return false;
		}
		document.getElementById("oid").value = officeId;
		return true;
	}

	function doLogout() {
		adminLogoutForm.submit();
	}
//-->
</script>
</head>
<body>

	<%@include file="/view/adminMenu.jsp" %>

	<div class="midBox">
		<div class="midTitle">岗位信息一览</div>
		<div class="cnt">

			<table width="100%" border="0" cellpadding="0" cellspacing="1"
				bgcolor="#E1E1E1">
				<tr>
					<td height="32" align="left" bgcolor="#FFFFFF" valign="middle"
						style="padding-left: 10px;"><b><span
							style="color: #666666">岗位信息一览</span></b></td>
				</tr>
				<form:form name="officeListForm" method="post"
					action="${contextPath}/officeList.action"
					commandName="OfficeListCommand">
					<form:hidden path="oid" />
					<tr bgcolor="#FFFFFF">
						<td colspan="2" valign="top" align="center" height="25"
							style="padding-top: 5px;">
							<table width="95%" border="0" cellpadding="4" cellspacing="0"
								bgcolor="#E1E1E1">
								<tr bgcolor="#ffffff">
									<td style="text-align: right; width: 10%;">公告：</td>
									<td style="text-align: left; width: 15%"><form:select
											path="examId" items="${OfficeListCommand.exams}" id="examId"
											itemLabel="name" itemValue="id" onchange="changeExam();">
										</form:select></td>
									<td style="text-align: right; width: 10%;">部门：</td>
									<td style="text-align: left; width: 20%""><form:select
											path="departId" id="departId" /></td>
								</tr>
								<tr bgcolor="#ffffff">
									<td style="text-align: right; width: 10%;">名称：</td>
									<td style="text-align: left; width: 15%"><form:input
											path="name" maxlength="32" size="15"
											cssClass="bbsInput_short" /></td>
									<td style="text-align: left; width: 15%" colspan="2"><input
										type="submit" value="筛选" name="btnSearch" />&nbsp;&nbsp;<input
										type="submit" value="追加" name="btnAdd" />&nbsp;&nbsp;<input
										type="button" value="返回"
										onclick="javascript:document.location='${contextPath}/announcementList.action'" /></td>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr bgcolor="#FFFFFF">
						<td colspan="2" valign="top" align="center"
							style="padding-top: 5px; padding-bottom: 5px;">
							<table width="99%" border="0" cellpadding="4" cellspacing="1"
								bgcolor="#E1E1E1">

								<tr bgcolor="#f7f7f7">
									<th style="width: 2%;" nowrap="nowrap">序号</th>
									<%--
									<th align="center">公告</th> --%>
									<th style="width: 12%;" align="center">招聘部门</th>
									<th style="width: 12%;" align="center">岗位类别</th>
									<th style="width: 7%;" align="center">岗位编号</th>
									<th style="width: 9%;" align="center">招聘职位数</th>
									<th style="width: 20%;" align="center">专业要求</th>
									<th align="center">岗位要求</th>
									<th style="width: 10%;" nowrap="nowrap"></th>
								</tr>
								<c:forEach items="${OfficeListCommand.result }" var="office"
									varStatus="status">
									<tr bgcolor="#ffffff">
										<td style="text-align: right" nowrap="nowrap">${status.index
											+ 1}</td>
										<%--
										<td>${office.examName}</td> --%>
										<td>${office.departName}</td>
										<td>${office.name}</td>
										<td align="center" nowrap="nowrap">${office.code}</td>
										<td style="text-align: right" nowrap="nowrap">${office.recruits
											}</td>
										<td>${office.major }</td>
										<td>${office.description }</td>
										<td nowrap="nowrap"><input type="submit" value="修改"
											name="actionEditO" onclick="return editO('${office.id}')"
											style="width: 50px;" />&nbsp;<input type="submit" value="删除"
											name="actionDeleteO"
											onclick="return deleteO('${office.id}');"
											style="width: 50px;" /></td>
									</tr>
								</c:forEach>
							</table>
						</td>
					</tr>
				</form:form>
			</table>
		</div>
	</div>
	<%@include file="/view/footer.jsp"%>
</body>
<script type="text/javascript">
<!--
changeExam();
 if ('${OfficeListCommand.departId}' != '') {
     document.getElementById("departId").value='${OfficeListCommand.departId}'; 
 }
//-->
</script>
</html>